using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page
{

    protected void Page_Load(object sender, EventArgs e)
    {
        

        if (Session["AdminName"] == null || Session["AdminName"].ToString().Equals(""))
        {
            Response.Redirect("AdminLogin.aspx");
        }
        else
        {
            lblUserName.Text = Session["AdminName"].ToString();
        }

        PlaceHolderUser.Controls.Clear();
        if (Request["subpara"] != null)
        {
            string mod = Request["subpara"].ToString();
            if (mod.Equals("qlnv"))
            {
                Control ctrl = Page.LoadControl("UserManagement.ascx");
                PlaceHolderUser.Controls.Add(ctrl);
            }
            else if (mod.Equals("product"))
            {
                Control ctrl = Page.LoadControl("ProductManagement.ascx");
                PlaceHolderUser.Controls.Add(ctrl);
            }
           else if (mod.Equals("rg"))
            {
                Control ctrl = Page.LoadControl("Register.ascx");
                PlaceHolderUser.Controls.Add(ctrl);
            }           
           else if (mod.Equals("productType"))
            {
                Control ctrl = Page.LoadControl("ProductType.ascx");
                PlaceHolderUser.Controls.Add(ctrl);
            }
           else if (mod.Equals("oders"))
            {
                Control ctrl = Page.LoadControl("QLDonHang.ascx");
                PlaceHolderUser.Controls.Add(ctrl);
            }
           else if (mod.Equals("createOrder"))
            {
                Control ctrl = Page.LoadControl("CreateOrderl.ascx");
                PlaceHolderUser.Controls.Add(ctrl);
            }
           else if (mod.Equals("feedback"))
            {
                Control ctrl = Page.LoadControl("FeedBack.ascx");
                PlaceHolderUser.Controls.Add(ctrl);
            }
           else if (mod.Equals("addproduct"))
            {
                Control ctrl = Page.LoadControl("AddProduct.ascx");
                PlaceHolderUser.Controls.Add(ctrl);
            }
            else if (mod.Equals("faq"))
            {
                Control ctrl = Page.LoadControl("FAQs.ascx");
                PlaceHolderUser.Controls.Add(ctrl);
            }
            else if (mod.Equals("payment"))
            {
                Control ctrl = Page.LoadControl("Payment.ascx");
                PlaceHolderUser.Controls.Add(ctrl);
            }
            else if (mod.Equals("delivery"))
            {
                Control ctrl = Page.LoadControl("DeliveryTypes.ascx");
                PlaceHolderUser.Controls.Add(ctrl);
            }
        }
     }
    protected void lbtLogOut_Click(object sender, EventArgs e)
    {
        Session.Remove("AdminName");
        Response.Redirect("AdminLogin.aspx");
    }
}
